package com.example.design.patterns.冰河.创建型模式.原型.冰河;

import com.example.design.patterns.冰河.创建型模式.原型.冰河.concreteProtoType.ConcreteProtoType;
import com.example.design.patterns.冰河.创建型模式.原型.冰河.protorype.ProtoType;

/**
 * Client：让一个原型克隆自身从而创建一个新的对象
 */
public class Test {
    public static void main(String[] args) {
        ConcreteProtoType prototype = new ConcreteProtoType("prototype");
        ProtoType clone = (ProtoType) prototype.clone();
        System.out.println(prototype.getName());
        System.out.println(clone.getName());
    }
}
